﻿namespace HTMLService
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;

    public partial class FareConditionsPop : System.Web.UI.UserControl
    {
        public string PopUpHeader { get; set; }
        public string PopUpContent { get; set; }
        public string Params { get; set; }
        public bool IsForwardJourney { get; set; }
        public int SolutionNumber { get; set; }
        public int SolutionIndex { get; set; }
        public Boolean isRoundTrip { get; set; }
        public Boolean JourneyType { get; set; }
        public Boolean isFirstClassType { get; set; }
        private int ClassIndex { get; set; }
        private int legIndex { get; set; }
        private int fareIndex { get; set; }
        private int fareConditionType { get; set; }
        private int ClassItemIndex = 0;
        private string SearchOptionType { get; set; }
        private int segmentcount = 1;
        private string basePassengerType { get; set; }

        private void PropertiesValuesBind()
        {
            if (Params != null && Params.Length > 0 && Params.Contains("|"))
            {
                string[] strCombined = Params.Split('|');
                SolutionIndex = Convert.ToInt32(strCombined[0]);
                isFirstClassType = Convert.ToBoolean(strCombined[1]);
                ClassIndex = Convert.ToInt32(strCombined[2]);
                legIndex = Convert.ToInt32(strCombined[3]);
                fareIndex = Convert.ToInt32(strCombined[4]);
                isRoundTrip = Convert.ToBoolean(strCombined[5]);
                fareConditionType = Convert.ToInt32(strCombined[6]);
                SearchOptionType = strCombined[7];
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            PropertiesValuesBind();
            DefaultPageBind();
            PopUpHeader = "PopUpHeader";
            PopUpContent = "PopUpContent";
        }

        private void DefaultPageBind()
        {
            rptSearchResultsSegment.DataSource = null;
            rptSearchResultsSegment.DataBind();
        }

        protected void rptSearchResultsSegment_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {

            }
        }

        protected void rptFares_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {

            }
        }
    }
}
